<? 

$right_width = 48; //den procentvise angivelse af højre kolonnes bredde.

//KAMPAGNENS HOVEDPERSONER 

$data['find_ikke'] = array(); //det array der skal indeholde id'erne på kampagnens hovedpersoner så de ikke bliver fundet i søgningen.


/*?>

<h3 class="rubrik">Hovedpersoner i <? echo anchor("core/vis/se/begivenhed/".$kampagne['id'],$kampagne['navn'], "class='ink'"); ?></h3>
<p class="rubrik" style="padding:0px 0px 10px 0px;">

<?
foreach($kampagne_hovedpersoner as $r3){
	echo "<p>";
	$width = $right_width;
	echo "<span style='width:".$width."%;float:right' class='rubrik'>".$r3['rollespiller']."</span>";
	echo anchor("core/vis/se/individ/".$r3['id'],$r3['navn'],"class='ink'");
	$data['find_ikke'][] = $r3['id'];
	echo "</p>";
}


*/?>

<p style="text-align: center">
<!--img title="Ny PC" src="<? echo base_url().'/img/ikoner/plus.png' ?>" onclick="showHide('nypc')" class="rubrik"></p-->
<div id="nypc">
<?
if($this->input->post('soeg')){
	$this->load->model('soeg/soeg_model');
	$data['kriterie'] = $this->input->post('kriterie');
	$data['omraade'] = $this->input->post('omraade');
	$data['resultater'] = $this->soeg_model->soeg($data['kriterie'], $data['omraade']);		
}

//SØGEPARAMETRE	
$data['type'] = "individ";
$data['redirect_soegning'] = base_url()."gamemaster/dashboard";
$data['redirect_tilfoej'] = base_url()."pc_haandtering/tilfoej_til_kampagne";
$data['omraade'] = "individ";
$data['stam_id'] = $ingame['ingame_id'];

?>

<? // ROLLESPILLER ?>
<div style="width:<? echo $right_width; ?>%;float:right"> <!-- højre kolonne -->
<div id="div_rs">
<div id="div_vaelg_rs_outer" style="cursor:pointer; border: solid grey 1px; padding:5px;">
<p style="float:right">
<? $input_data = array('span_id' => 'img_vaelg_rs');
$this->load->view("includes/js/tjek_ikoner_view", $input_data); ?>
</p>
<h3 class="rubrik">Vælg rollespiller</h3>
<div id="div_vaelg_rs_inner">
<p class="rubrik">Vælg:
<select id="vaelg_rs">
<?
foreach($rollespillere as $r){
	?>
	<option value="<? echo $r['id']; ?>"><? echo $r['navn']; ?></option>
	<?
}

?>
</select></p>
</div> <!-- id="div_vaelg_rs_inner" -->
</div> <!-- id="div_vaelg_rs_outer" -->
<br>
<div id="div_opret_rs_outer" style="cursor:pointer; border: solid grey 1px; padding:5px">
<p style="float:right">
<? $input_data = array('span_id' => 'img_opret_rs');
$this->load->view("includes/js/tjek_ikoner_view", $input_data); ?>
</p>
<h3 class="rubrik">Opret rollespiller</h3>
<div id="div_opret_rs_inner" style="display:none">
<p class='rubrik'>Brugernavn:
<input id="opret_rs_brugernavn" style="width:100px" type="text"></p>
<p class='rubrik'>Navn:
<input id="opret_rs_navn" style="width:130px" type="text"></p>
<p class='rubrik'>Efternavn:
<input id="opret_rs_efternavn" style="width:100px" type="text"></p>
<p class='rubrik'>Kodeord:
<input id="opret_rs_kodeord" style="width:90px" type="text"></p>
</div> <!-- id="div_opret_rs_inner" -->
</div> <!-- id="div_opret_rs_outer" -->
</div> <!-- id="div_rs" -->
</div> <!-- højre kolonne -->


<?	
		echo " ";
?>



<? // PC ?>
<div id="div_pc" style="width:<? echo $right_width; ?>%"> <!-- venstre kolonne -->
<div id="div_vaelg_pc_outer" style="cursor:pointer; border: solid grey 1px; padding:5px">
<p style="float:right">
<? $input_data = array('span_id' => 'img_vaelg_pc');
$this->load->view("includes/js/tjek_ikoner_view", $input_data); ?>
</p>
<h3 class="rubrik">Vælg PC</h3>
<div id="div_vaelg_pc_inner">


<p class="rubrik">Søg: <input style="width:100px" type="text" id="navn">
<input id="gmdash_soeg" style="width:50px" class="rubrik" type="submit" id="navn-submit" value="Find"></p>

<div id="gmdash_soeg_resultater">
	
</div>

<script type="text/javascript" src="<? echo base_url(); ?>scripts/soeg_gm_dash.js"></script>
</div> <!-- id="div_vaelg_pc_inner" -->
</div> <!-- id="div_vaelg_pc_outer" -->
<br>
<div id="div_opret_pc_outer" style="cursor:pointer; border: solid grey 1px; padding:5px;">
<p style="float:right">
<? $input_data = array('span_id' => 'img_opret_pc');
$this->load->view("includes/js/tjek_ikoner_view", $input_data); ?>
</p>
<h3 class="rubrik">Opret PC</h3>
<div id="div_opret_pc_inner" style="display:none">
<p class='rubrik'>Navn:
<input id="pc_navn" style="width:140px" type="text"></p>

<p class='rubrik'>Æt:
<?
$e = new element();
$e->find_alle_af_type('race');
$racer = $e->alle_af_type;
?>
<select id="race" selected><?
foreach($racer as $a)
{
	if($a['id'] == 232) 
	{
?>	
		<option selected value="<? echo $a['id']; ?>"><? echo $a['navn']; ?></option>	
<?
	}
	else{
	?>
		<option value="<? echo $a['id']; ?>"><? echo $a['navn']; ?></option>	
	<?	}
}
?>
</select>
</p>
<p class='rubrik'>Tilhørsforhold:
<?
$this->load->model('core/gruppe');
$element = new gruppe();
$element->find_alle_grupper();
$alle_grupper = $element->alle_grupper;

?><select id="select_over" name="over"><?
foreach($alle_grupper as $r)
{
	?>
		<option title="<? echo $r['navn']; ?>" value="<? echo $r['id']; ?>"><? echo substr($r['navn'],0,25)."..."; ?></option>	
	<?	
}
?>
</select>
</p>
</div><!-- id="div_opret_pc_inner" -->
</div><!-- id="div_opret_pc_outer" -->
</div><!-- id="div_pc" venstre kollonne -->
<br>
<form action="<? echo base_url().'core/opret/pc'; ?>" method="post" style="float:right" id="opret">
<div id="pc_info">
</div> <!-- id="pc_info" -->
<div id="rs_info">
</div> <!-- id="rs_info" -->
<input id="opret-knap" type="submit" value="Opret" disabled>
</form>
</div><!-- id="nypc" -->

<script type="text/javascript" src="<? echo base_url(); ?>scripts/search.js"></script>

<?

/*		if($ingame['ingame_id'] == 0)
		{	?>
			<form style="text-align:left;float:right;width:250px;" action="<? echo base_url(); ?>core/rediger/begivenhed_deltager/tilfoej/<? echo $kampagne['id']; ?>" method="post">	
			<input type="submit" class="terninger" value="">
				
			<input type="hidden" name="vinkel" value="session">
			<input type="hidden" name="kampagne_id" value="<? echo $kampagne['id']; ?>">
			<select name="deltager_id" style="margin:0px;">
				<?

				foreach($alle_pcer as $r)
				{
			
						?>
							<option value="<? echo $r['id_karakter']; ?>"><? echo $r['karakter']; ?></option>
						<?
			
		
				}
				?>
			</select>

			</form>
</div>


<?			
		}

?>
</div>

<?

// MELD EN KARAKTER TIL KAMPAGNEN
	








/*

 
if($naeste_session != 0)
{ 	
	if($ingame['ingame_id'] != 0)
	{	?>

		
<br>
	<h3 class="rubrik">Meld dig til næste session - <? echo anchor("deltager/dashboard/".$ingame['ingame_id']."/alle_sessioner","se alle sessioner","class='rubrik'"); ?></h3>	
	<div style="padding:10px;border:solid 1px #BEBAA0;">




	<form action="<? echo base_url(); ?>core/rediger/begivenhed_deltager/tilfoej/<? echo $naeste_session['id']; ?>" method="post">	

		
		<?  $er_jeg_tilmeldt = "nej";
		foreach($rollespillere as $r3)
		{
		
			if($ingame['ingame_id'] == $r3['id'])
			{
				$er_jeg_tilmeldt = "ja";
			}

			if($er_jeg_tilmeldt == "nej")
			{
		?>			<input type="submit" class="terninger" value="" title="Tilmeld <? echo $ingame['ingame_navn'];?> <? echo $naeste_session['navn'];?>" >
				<?
			}
			else
			{
				echo anchor
				(
					"core/rediger/begivenhed_deltager/slet/".$naeste_session['id']."/".$ingame['ingame_id']."/session/".$kampagne['id'],
					" ",
					"class='terninger_frameld' style='float:right;' title='Frameld ".$ingame['ingame_navn']." ".$naeste_session['navn']." '"
				);	?>

		
			<?
			}
		}	
		?>




	
			<input type="hidden" name="vinkel" value="session">
			<input type="hidden" name="kampagne_id" value="<? echo $kampagne['id']; ?>">
			<input type="hidden" name="deltager_id" value="<? echo $deltager_ingame['ingame_id']; ?>">

			</form>






		<h2 class="ink" >
			<? echo anchor("core/vis/se/begivenhed/".$naeste_session['id'],$naeste_session['navn'],"class='ink'");?>
				</h2><p class="ink" style="font-size:12px;">
					<span class="rubrik" style="font-weight:bold;">Dato:</span> <? echo date('d-m-Y ',$naeste_session['offgame_start']);?><br>
					<span class="rubrik" style="font-weight:bold;">kl:</span> <? echo date('H:i',$naeste_session['offgame_start']);?>
				</p>
		
			
	

		</h3>
		<br>
		<h4 class="rubrik">
			Tilmeldte
		</h4>
	

		<p class="rubrik" style="padding:0px 0px 10px 0px;font-weight:bold;">
			<?

			foreach($rollespillere as $r2)
			{
				echo $r2['rollespiller']." aka <span class='ink'>".$r2['karakter']."</span><br/>";
			}

			?>
		</p>
	</div>


<?
}
else
{
	echo "Der er ingen session i denne kampagne";
}
*/


?>
